<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>天高智慧</title>
<link href="./res/style/main.css" rel="stylesheet" type="text/css" />
<link href="./res/style/index.css" rel="stylesheet" type="text/css" />
<script language="javascript" type="text/javascript" src="./res/script/jquery-1.4.2.min.js"></script>
<script language="javascript" type="text/javascript" src="./res/script/js.js"></script>

<script src="./res/script/jquery.boxy.js" type="text/javascript" language="javascript" ></script>
<link rel="stylesheet" href="./res/style/boxy.css"  />
<?php $this->listScript(); ?>
<script>

var MessageStatus = 1;  //提示框状态，1 最小化 2 最大化 3是关闭

/** AUKEY Defined **/
AUKEY = 'cevin';
/** defeins **/
INPUT_POST = <?php echo $this->input_post; ?>;
INPUT_GET = <?php echo $this->input_get; ?>;

Array.prototype.removeByIndex = function(i){
  if (i < this.length && i >= 0) {
      var ret = this.slice(0, i).concat(this.slice(i + 1));
      this.length = 0;
      this.push.apply(this, ret);
  }
}
Array.prototype.getIndexByVal = function (val){
    var tmp = this;
    for (var i=0;i<tmp.length ;i++ )
    {
        if(tmp[i]==val) {
            return i;
        }
    }
}

function dialogMessage(text,color){
    var dialog = $('#loading');
    dialog.css('background',color);
    dialog.html(text);
    dialog.show();
    dialog.fadeOut(2000);
}

function switchTab(obj,tab_name) {
}

$.ajaxSetup({
    cache:false,
    beforeSend:function() {
        var dialog = $('#loading');
        dialog.html('请稍等');
        dialog.css('background','yellow');
        dialog.show();
    },
    complete:function(xhr,state){
        var dialog = $("#loading");
        if ('parsererror' == state)
        {
            dialogMessage('Error:01','red');
            return false;
        }
        dialog.fadeOut(2000);
    },
    success:function(data){
        if (data.state <= 0)
        {
            alert(data.message);
            return false;
        }
        dialogMessage(data.message,'green');
    }
});


function ExecMax()
{
	$('#ymessage').animate({bottom:'0px'},1000);
	MessageStatus =2;
}


function ExecMin()
{
	$('#ymessage').animate({bottom:'-'+ ($('.content').height()+2) +'px'},1000);
	MessageStatus =1;
}



$(function(){
    $('input[type=checkbox][checkfor]').click(function() {
        var checklabel = $(this).attr('checkfor');
        var chks =  $('input[type=checkbox][checklabel='+checklabel+']');
        if ($(this).attr('checked'))
        {
            chks.attr('checked','true');
        }
        else
        {
            chks.removeAttr('checked');
        }
    });
    $('img[href]').click(function(){
        location.href=$(this).attr('href');
    });
	
	
	$('#btn_min').click(function(){
         var att = $(this).attr('class');
		 if(att=='max')
		 {
			 MessageStatus = 2;
			 ExecMax();
			 $(this).attr('class','min')
		 }
		 else
		 {
			 MessageStatus = 1;
			 ExecMin(); 
			 $(this).attr('class','max')
		 }
    });
	
	$('#btn_close').click(function(){
        $('#ymessage').hide("slow"); 
    });
	
});

</script>
</head>
<style>body {
background: none;
}</style>
<body>
<!--加载-->
<div id="Layer1"></div>
<div class="loading" id="loading"><img src="./res/image/loading.gif" /></div>

<!--消息提示-->
<div class="bottom_message" id="ymessage" style="width:auto;height:auto;bottom:-600px;">
	<div class="float_layer">
        <h2>
        <strong>提示</strong>
        <a id="btn_min" href="javascript:;" class="min"></a>
        <a id="btn_close" href="javascript:;" class="close"></a>
        </h2>
        <div class="content">
             <div class="wrap" id="mess"></div>
        </div>
    </div>
</div>

<div class="main_td">
<div class="page_now">
      <div class="fl"><a href="javascript:;">天高智慧管理中心</a><span><?=$this->menu_name?></span><span><?=$this->menu_group_name?></span><span><?=$this->node_name?></span></div>
      <div class="fr"><?php echo $this->headlink; ?></div>
</div>
<div class="line_1"></div>
<?=$this->render($this->load_tpl)?>
<div class="line_1"></div>

</div>

<script>
cnoh = '';
function checknotice() {
    $.post('?app=portal&mod=cno',{r:Math.random()},function(data){
        if (data.state > 0)
        {
			$('#mess').html(data.message)
			if(MessageStatus==1)
			{
				MessageStatus =2;
				$('#ymessage').animate({bottom:'0px'},4000);
				setTimeout("ExecMin()", 10000);
			}
			else if(MessageStatus==2)
			{
				
			}
			else//3
			{
				
			}
        }
    },'json');
}
cnoh = setInterval('checknotice()',10000);
</script>
</body>
</html>
